local modname = minetest.get_current_modname()
-- local modpath = minetest.get_modpath(modname)
local S = minetest.get_translator(modname)

if not mobs_npc.default_dialogs then
  mobs_npc.default_dialogs = {}
end

local npc_dialogs = mobs_npc.default_dialogs

table.insert(npc_dialogs, {
    '===Start',
    S('Hello @1.', '@[playername]@'),
    S('How are you ?'),
    '>fine:'..S('I am fine. Thank you'),
    '>bad:'..S('I could be better...'),
    '>end:'..S('None of your buisness, good bye !'),
    '===fine',
    S('Glad to hear it !'),
    '>end:'..S('Thanks, good bye then!'),
    '===bad',
    S('Oh... I am very sorry to hear that.'),
    S('I hope you get well soon.'),
    '>end:'..S('Oh well, good bye then!'),
})

table.insert(npc_dialogs, {
    '===Start(1)',
    S('Hello @1.', '@[playername]@'),
    '>end:'..S('Sorry I am quite busy at the moment.')..' '.. S('No time to chat'),
    '===Start(8)',
    S('Hi.'),
    S('Sorry I am quite busy at the moment.'),
    '>rude:'..S('That is a bit rude !'),
    '>end:'..S('Oh well, good bye then!'),
    '===rude',
    S('Oh. Sorry. Again. But really, no time to chat...'),
    '>end:'..S('Ok bye !'),
})

table.insert(npc_dialogs, {
    '===Start',
    ":if (isInList(friendlist,@[playername]@)) then goto friendly",
    S('Hello what is your name ?'),
    '>befriend:'..S('My name is @1 and I want to be your friend !', '@[playername]@'),
    '>end:'..S('None of your buisness, good bye !'),
    '===friendly',
    S('Hi @1', '@[playername]@.'),
    S('It is nice to see a friendly face '),
    '>unfriend:'..S('Leave me alone ! I am not your friend !'),
    '>end:'..S('Oh well, good bye then!'),
    '===befriend',
    ':set FriendList=add(FriendList,@[playername]@)',
    S('Great ! let us be friends then !'),
    '>end:'..S('Ok bye !'),
    '===unfriend',
    ':set FriendList=rmv(FriendList,@[playername]@)',
    S('Oh that is too bad... Bye then'),
    '>end:'..S('Bye !'),
})

mobs_npc.default_dialogs['mobs_npc:npc'] = npc_dialogs
